package com.nuaa.shopping.dao.impl;

import com.nuaa.shopping.dao.ItemDao;
import com.nuaa.shopping.entity.Item;
import com.nuaa.shopping.util.JdbcTemplate;

public class ItemDaoImpl implements ItemDao{

	@Override
	public void insert(Item item) {
		String sql = new StringBuffer()
			.append(" insert into t_item ")
			.append(" 	(product_id,num,price,order_id) ")
			.append(" values ")
			.append(" 	(?,?,?,?) ")
			.toString();
		JdbcTemplate.update(sql, item.getProduct().getId(),item.getNum(),item.getPrice(),item.getOrder().getId());
	}

}
